A color space is a region in a 3-dimensional or higher dimensional vector space. Any basis, such as three linearly independent 3-dimensional vectors, defines a color coordinate system. A commonly used color coordinate system is the R(red), G(green), and B(blue), defined by their center wavelengths. Given one 3-dimensional color coordinate system, other 3-dimensional linear color coordinate systems may be represented by an invertible (non-singular) 3.times.3 matrix. For example, the Y, I, Q color coordinate system is defined in terms of R, G, B by the following matrix: ##EQU1## Note that not all color spaces are linear. For example, to better model the human visual system, some color conversions attempt to non-linearly re-scale vectors (e.g., logrithmically). Examples are CIE L*u*v* and L*a*b*.
Different color coordinate systems are defined for various reasons. For example, for data to be displayed on monitors, it is convenient for most digital color images to use the R, G, B coordinate system, in fixed range, such as 8 bits per coordinate. If the application requires color decorrelation, such as compression, then R, G, B is far from optimal. Other color coordinates such as Y, I, Q mentioned above are more appropriate. Other color coordinates include YUV and YC.sub.r C.sub.b. All of these opponent coordinate systems attempt to provide good luminance and chrominance separation, which is a change in how characters or color appear and how a change in chrominance would appear with the same luminance in related brightness.
For images used for printing, subtractive color systems, such as CYM (cyan, yellow, magenta), are sometimes used. In some applications, over complete 4-dimensional color spaces, such as CMYK (cyan, yellow, magenta, black), are used.
Data compression is an extremely useful tool for storing and transmitting large amounts of data. For example, the time required to transmit an image, such as a facsimile transmission of a document, is reduced drastically when compression is used to decrease the number of bits required to recreate the image.
Many different data compression techniques exist in the prior art. Compression techniques can be divided into two broad categories, lossy coding and lossless coding. Lossy coding involves coding that results in the loss of information, such that there is no guarantee of perfect reconstruction of the original data. The goal of lossy compression is that changes to the original data are done in such a way that they are not objectionable or detectable. In lossless compression, all the information is retained and the data is compressed in a manner which allows for perfect reconstruction.
In lossless compression, input symbols or intensity data are converted to output codewords. The input may include image, audio, one-dimensional (e.g., data changing temporally), two-dimensional (e.g., data changing in two spatial directions), or multi-dimensional/multi-spectral data. If the compression is successful, the codewords are represented in fewer bits than the number of input symbols (or intensity data). Lossless coding methods include dictionary methods of coding (e.g., Lempel-Ziv), run-length encoding, enumerative coding and entropy coding. In lossless image compression, compression is based on predictions or contexts, plus coding. The JBIG standard for facsimile compression and DPCM (differential pulse code modulation--an option in the JPEG standard) for continuous-tone images are examples of lossless compression for images. In lossy compression, input symbols or intensity data are quantized prior to conversion to output codewords. Quantization is intended to preserve relevant characteristics of the data while eliminating less important data. Prior to quantization, lossy compression system often use a transform to provide energy compaction. Baseline JPEG is an example of a lossy coding method for image data.
Traditionally, converting between color coordinates has been used with quantization for lossy compression. In fact, some color spaces, such as CCIR 601-1 (YC.sub.R B.sub.R) are intentionally lossy. In some lossless or lossless/lossy systems, the primary requirement is the reversibility and the efficiency of the conversion. In other lossless/lossy systems, in addition to efficiency of the reversible conversion, the color decorrelation may also be a factor. For example, the 3.times.3 matrix above is only useful for lossy compression since its entries are non-integer and, thus, will add error during repeated compression and decompression when decorrelation is required. Also the application of the 3.times.3 matrix is not good with respect to lower order bits. That is, the application of the 3.times.3 matrix requires use of extra bits to obtain necessary precision and to ensure being able to perform the inverse while being able to reconstruct the lower order bits later-these extra bits reduce compression.
When performing color space conversions, numeric precision problems occur. For instance, in a case where eight bits are input, the transform space required is typically 10 or 11 bits, and even higher precision in the internal calculations, just to obtain a stable color space. If a process within sufficient precision is repeatedly applied in which images are converted from an RGB color space and compressed, and decompressed and returned to RGB, the result is an accumulation of errors, such that the original colors and the final colors may not match. This is referred to as color drift or the result of an unstable color space.
The present invention provides color conversion. The color conversion of the present invention is completely reversible and may be used with compression/decompression. Because the color conversion is completely reversible, the present invention may be used as part of a lossless compression/decompression process and system.